package com.dwy2002.user;


import com.dwy2002.common.Result;
import com.dwy2002.common.annotation.RequiresPermission;
import com.dwy2002.enums.Logical;
import com.dwy2002.pojo.dto.users.RoleUserDTO;
import com.dwy2002.user.service.IRoleUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杜伟毅
 * @version 1.0
 * @since 2025/03/17
 */
@RestController
@RequestMapping("/roleUser")
@RequiredArgsConstructor
public class RoleUserController {
    private final IRoleUserService service;

    /**
     * 修改用户角色（管理员）
     *
     * @author 杜伟毅
     * @since 2025/3/17 0017 21:17
     */
    @RequiresPermission(value = {"A8"}, logical = Logical.OR)
    @PutMapping
    public Result<Void> updateRoleUser(@RequestBody RoleUserDTO dto) {
        return service.updateRoleUser(dto);
    }
}
